package com.shg.service.impl;
import java.util.List;

import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;

import com.shg.bean.Shop;
import com.shg.service.ShopService;

@Service
public class ShopServiceBean extends BasiceDaoImpl<Shop> implements ShopService {

	/**
	 * 进入店铺
	 * @param shopid
	 */
	@SuppressWarnings("unchecked")
	public Shop getIntoshop(String shopid){
		//查询店铺
		List<Shop> shops = sessionFactory.getCurrentSession().createCriteria(Shop.class)
							.add(Restrictions.idEq(shopid))
							.add(Restrictions.eq("state", 1))
		.list();
		Shop  shop = shops.get(0);
		return shop;
	}
}
